<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <title>作业列表</title>
    <style>
        .container { width: 80%; margin: 0 auto; padding: 20px; }
        table { width: 100%; border-collapse: collapse; }
        th, td { padding: 8px; border: 1px solid #ddd; }
        th { background-color: #f4f4f4; }
    </style>
</head>
<body>
    <div class="container">
        <h1>作业列表</h1>
        <table>
            <thead>
                <tr>
                    <th>标题</th>
                    <th>发布时间</th>
                    <th>截止日期</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <c:forEach items="${assignments}" var="assignment">
                    <tr>
                        <td>${assignment.title}</td>
                        <td><fmt:formatDate value="${assignment.publishTime}" pattern="yyyy-MM-dd HH:mm"/></td>
                        <td><fmt:formatDate value="${assignment.deadline}" pattern="yyyy-MM-dd HH:mm"/></td>
                        <td>${assignment.status}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/student/assignment/view?aid=${assignment.aid}">
                                查看详情
                            </a>
                        </td>
                    </tr>
                </c:forEach>
            </tbody>
        </table>
    </div>
</body>
</html> 